package org.shilong.ViewUtility;

import org.shilong.UI.R;

import android.content.Context;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.PopupWindow;

public class MyAnimationUtils {

	/**
	 * 关闭布局动画
	 * @param view
	 * @param mContext
	 * @param pop
	 */
	public  static void closeLayout( ImageView view, Context mContext, final PopupWindow pop ){

		Animation anim = AnimationUtils.loadAnimation( mContext, R.anim.anim_close_button_close );

		anim.setAnimationListener( new Animation.AnimationListener() {

			@Override
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub

			}

			@Override
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub

			}

			@Override
			public void onAnimationEnd(Animation animation) {
				// TODO Auto-generated method stub

				pop.dismiss();
			}
		});

		view.startAnimation(anim);
	} 

}
